/**
 * 
 */
package com.zcm.service.weibo.serviceprovider.sina.api.impl;

import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.social.oauth1.AbstractOAuth1ApiBinding;

import com.zcm.service.weibo.serviceprovider.sina.api.CommentOperations;
import com.zcm.service.weibo.serviceprovider.sina.api.SinaWeibo;
import com.zcm.service.weibo.serviceprovider.sina.api.TimelineOperations;
import com.zcm.service.weibo.serviceprovider.sina.api.UserOperations;


/**
 * @author xiongj
 * 
 */
public class SinaWeiboTemplate extends AbstractOAuth1ApiBinding implements SinaWeibo {
	
	private UserOperations userOperations;
	
	private TimelineOperations timelineOperations;
	
	private CommentOperations commentOperations;
	
	private ObjectMapper objectMapper;

	/**
	 * 
	 */
	public SinaWeiboTemplate() {
		super();
		initialize();
	}

	/**
	 * @param consumerKey
	 * @param consumerSecret
	 * @param accessToken
	 * @param accessTokenSecret
	 */
	public SinaWeiboTemplate(String consumerKey, String consumerSecret, String accessToken,
			String accessTokenSecret) {
		super(consumerKey, consumerSecret, accessToken, accessTokenSecret);
		initialize();
	}

	private void initialize() {
		userOperations = new UserTemplate(this, getRestTemplate(),isAuthorized());
		//timelineOperations = new Timeline
	}

	/**
	 * @return the userOperations
	 */
	public UserOperations userOperations() {
		return userOperations;
	}

	public TimelineOperations timelineOperations() {
		return null;
	}

	public CommentOperations commentOperations() {
		return null;
	}

}
